home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
oper_sys
/
amber
/
amber.lha
/
Sup.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-25
|
2KB
|
56 lines
static char rcsid[] = "$Header: /var/a/oriole/u1/thekkath/amber/RCS/Sup.c,v 1.1 90/08/22 16:55:11 thekkath Exp Locker: thekkath $";
#include <stdio.h>
#include "Defs.h"
#include "Call.h"
#include "Segment.h"
#include "Memory.h"
#include "machdep.h"
#include "hosts.h"
#include "Rpc.h"
#include <stdlib.h>
#include <string.h>
#include <osfcn.h>
int ClientCheckIn(struct amberhost *master, int nodeid)
{
if (!rpc->CheckIn(master,nodeid)) {
Panic("Client: checkin");
}
pout("Client waiting for checkin ack");
rpc->WaitForMasterAck();
pout("Client done waiting for master to ack checkin");
return 1;
}
/*
* Main procedure for a slave node. Get startup parameters from the command
* line arguments. Start the local node and check in with the master. When
* CheckIn returns all the other nodes have started and we're off and running.
*/
void SlaveMain(struct amberhost *master, char *argv[])
{
int totalNodes;
int quantum;
int cpus;
int nodeId;
nodeId = atoi(argv[5]);
totalNodes = atoi(argv[6]);
cpus = atoi(argv[7]);
quantum = atoi(argv[8]);
pout("executing on remote node");
/* Init memory manager on slave node */
MemManager.init(nodeId);
/* start the slave server forrpc */
rpc->Export(nodeId,atoi(argv[3]),atoi(argv[4]));
AmberEntry_StartNode(nodeId, totalNodes, cpus, quantum);
if (ClientCheckIn(master,nodeId) != 0) {
AmberEntry_RunNode(nodeId);
}
rpc->ShutDown();
}